package org.wheel.quartz;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Map;

/**
 * @author klaus
 * @date 2021/6/30 华小勇 15:45
 */
@ConfigurationProperties("spring.quartz.properties")
public class QuartzProps {

    private Map<String, QuartzJob> dynamicJobs;

    public void setDynamicJobs(Map<String, QuartzJob> dynamicJobs) {
        this.dynamicJobs = dynamicJobs;
    }

    public Map<String, QuartzJob> getDynamicJobs() {
        return dynamicJobs;
    }

    public static class QuartzJob {

        String name;
        String bean;
        String method;
        String groupName;
        String cron;
        String desc;

        public String getBean() {
            return bean;
        }

        public void setBean(String bean) {
            this.bean = bean;
        }

        public String getMethod() {
            return method;
        }

        public void setMethod(String method) {
            this.method = method;
        }

        public String getGroupName() {
            return groupName == null ? "zciss-job" : groupName;
        }

        public void setGroupName(String groupName) {
            this.groupName = groupName;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getCron() {
            return cron;
        }

        public void setCron(String cron) {
            this.cron = cron;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }
}
